package com.linjiang.server.transactional;

import com.linjiang.server.util.Task;

/**
 * 分支事务信息
 */
public class BatchTransaction {

    private String groupId;//全局事务组id
    private String transactionId;//本地分支事务id
    private TransactionStatus transactionStatus;   //分支事务状态 commit-待提交，rollback-待回滚
    private Task task = new Task();

    public BatchTransaction(String groupId, String transactionId) {
        this.groupId = groupId;
        this.transactionId = transactionId;
        this.task = new Task();
    }

    public BatchTransaction(String groupId, String transactionId, TransactionStatus transactionStatus) {
        this.groupId = groupId;
        this.transactionId = transactionId;
        this.transactionStatus = transactionStatus;
    }

    public Task getTask() {
        return task;
    }

    public String getGroupId() {
        return groupId;
    }

    public void setGroupId(String groupId) {
        this.groupId = groupId;
    }

    public String getTransactionId() {
        return transactionId;
    }

    public void setTransactionId(String transactionId) {
        this.transactionId = transactionId;
    }

    public TransactionStatus getTransactionStatus() {
        return transactionStatus;
    }

    public void setTransactionType(TransactionStatus transactionStatus) {
        this.transactionStatus = transactionStatus;
    }
}
